package com.bing.dao;

import com.bing.bean.sys.SysPermission;
import com.bing.bean.sys.SysUser;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by Administrator on 2015/6/13.
 */

@Repository
public interface SysPermissionDao {

    int createSysUser(SysUser user);

    /**
     * 根据角色ID查找对应权限列表
     *
     * @param roldId
     * @return
     */
    @Select("select * from SysPermission p, Role_Permission rp where rp.roleId=#{roldId} and rp.permissionId=p.id")
    List<SysPermission> findPermissionsByRoleId(int roldId);


}
